package com.sharding.controller;

import com.sharding.entity.Address;
import com.sharding.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("address")
public class AddressController {

    @Autowired
    private AddressService addressService;

    @GetMapping("/select")
    public List<Address> select() {
        return addressService.getAddressList();
    }

    @GetMapping("/insert")
    public Boolean insert(Address address) {
        return addressService.save(address);
    }
}
